package svgundoredo;

/**
 * This is re size command
 */
import svgedit.gui.controlpoints.ControlPoint;

public class ResizeElementCommand extends AbstractCommand
{
    private ControlPoint controlPoint;
    private int newX, newY, oldX, oldY;
    
    /**
     * @param controlPoint
     * @param newX
     * @param newY
     * @param oldX
     * @param oldY
     */
    public ResizeElementCommand(ControlPoint controlPoint, int newX, int newY,
            int oldX, int oldY)
    {
        this.controlPoint = controlPoint;
        this.newX = newX;
        this.newY = newY;
        this.oldX = oldX;
        this.oldY = oldY;
    }
    
    @Override
    public void execute()
    {
        controlPoint.set(newX, newY);
    }
    
    @Override
    public void undo()
    {
        controlPoint.set(oldX, oldY);
    }
    
}
